* {
  margin: 0;
  padding: 0;
}

.box {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

ul {
  list-style: none;
}

#wrap {
  position: relative;
  width: 70vw;
  height: 80vh;
  border: 1px solid #9cc5ef;
  border-radius: 5px;
  overflow: hidden;
}

#slider {
  width: 300%;
  height: 100%;
  font: 100px/400px Microsoft Yahei;
  text-align: center;
  color: #fff;
  margin-left: 0;
  animation: slide1 6s ease-in-out infinite;
}

#slider li {
  float: left;
  width: 70vw;
  height: 100%;
}

#slider img {
  width: 100%;
  height: 100%;
}

/*创建三种动画策略*/
@keyframes slide1 {
  0% {
    margin-left: 0;
  }

  23% {
    margin-left: 0;
  }

  33% {
    margin-left: -70vw;
  }

  56% {
    margin-left: -70vw;
  }

  66% {
    margin-left: -140vw;
  }

  90% {
    margin-left: -140vw;
  }

  100% {
    margin-left: 0;
  }
}

@keyframes slide2 {
  0% {
    margin-left: -70vw;
  }

  23% {
    margin-left: -70vw;
  }

  33% {
    margin-left: -140vw;
  }

  56% {
    margin-left: -140vw;
  }

  66% {
    margin-left: 0;
  }

  90% {
    margin-left: 0;
  }

  100% {
    margin-left: -70vw;
  }
}

@keyframes slide3 {
  0% {
    margin-left: -140vw;
  }

  23% {
    margin-left: -140vw;
  }

  33% {
    margin-left: 0;
  }

  56% {
    margin-left: 0;
  }

  66% {
    margin-left: -70vw;
  }

  90% {
    margin-left: -70vw;
  }

  100% {
    margin-left: -140vw;
  }
}


/*当点击对应按钮时显示对应的动画*/
#first:checked~#slider {
  animation-name: slide1;
}

#second:checked~#slider {
  animation-name: slide2;
}

#third:checked~#slider {
  animation-name: slide3;
}


/*短暂地取消动画名称，模拟重启动画*/
#first:active~#slider {
  animation-name: none;
  margin-left: 0;
}

#second:active~#slider {
  animation-name: none;
  margin-left: -70vw;
}

#third:active~#slider {
  animation-name: none;
  margin-left: -140vw;
}

#opts {
  width: 20%;
  height: 80px;
  color: #fff;
  text-align: center;
  font: 16px/30px Microsoft Yahei;
  position: absolute;
  bottom: 10vh;
  display: flex;
  justify-content: space-around;
  align-items: center;
}

#opts label {
  float: left;
  width: 30px;
  height: 30px;
  background: #cccccc;
  cursor: pointer;
  border-radius: 50%;
  transition: .3s;
}

#opts label:hover {
  background: #405871;
}

/* 隐藏Input按钮*/
input {
  display: none;
}